<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="theme-color">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>分享家</title>
    <link rel="stylesheet" type="text/css" href="../lib/css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../lib/css/mui.css"/>
    <link rel="stylesheet" href="../css/util.css">
    <script src="http://at.alicdn.com/t/font_371407_7omis3wrfr7tx1or.js"></script>
</head>
<link rel="stylesheet" href="../css/indent_detail.css">
<body>
<header class="fxj-header">
    <back></back>
    <h1 class="fxj-title">订单详情</h1>
</header>

<main id="main">
    <div class="indent-status">
        <svg class="icon highlight">
            <use v-show="smile" xlink:href="#icon-smile"></use>
            <use v-show="!smile" xlink:href="#icon-bukaixin"></use>
        </svg>
        <div>
            <span class="highlight" v-cloak>{{info.status.value}}</span>
            <span class="small" v-if="info.status.status===1" v-cloak>房东还未接受订单，请耐心等待</span>
            <span class="small" v-if="info.status.status===2" v-cloak>房东已接受订单，请您在2小时内付款，超时订单将自动失效。</span>
            <span class="small" v-if="info.status.status===3" v-cloak>您的入住时间为{{info.start_date}} - {{info.end_date}}，请提前与房东联系准备入住事宜。</span>
            <span class="small" v-if="info.status.status===4" v-cloak>您将体验{{info.day_total}}天的居家之旅，祝您旅途愉快！</span>
            <span class="small" v-if="info.status.status===0" v-cloak>抱歉，订单已经失效。</span>
        </div>
    </div>

    <div class="house-res">
        <div class="title" @click="goHouseResDetail(info.house_id)" v-cloak>
            {{info.title}}
        </div>
        <div class="house-guys" @click="goHouseResDetail(info.house_id)">
            <img :src="info.img" v-cloak>
            <div class="house-des">
                <div v-cloak>{{new Date(Number(info.start_date+'000')).toLocaleDateString().replace(/\//g,'.')}}-{{new
                    Date(Number(info.end_date+'000')).toLocaleDateString().replace(/\//g,'.')}} 共{{info.day_total}}晚
                </div>
                <div v-cloak>预定类型：{{info.lease_type.value}}</div>
                <div v-cloak>入住人数：{{info.guest_count}}人</div>
            </div>
        </div>
        <div class="line">
            <span v-cloak>房东姓名：{{info.landlord_nickname}}</span>
            <span class="highlight" @click="chatting(info.landlord_id)">
                <svg class="icon">
                    <use xlink:href="#icon-liaotian1"></use>
                </svg>
                在线联系
            </span>
        </div>
        <div class="line">
            <a style="color: black" :href="'tel:'+info.landlord_phone" v-cloak>房东手机：{{info.landlord_phone}}</a>
            <span class="highlight" @click="call(info.landlord_phone)">
                <svg class="icon">
                    <use xlink:href="#icon-shouji"></use>
                </svg>
                拨打电话
            </span>
        </div>
        <!--<div class="line">
            <span class="address" v-cloak>入住地址：地址地址地址地址地址地址地址地址地址</span>
            <svg class="icon highlight">
                <use xlink:href="#icon-location-c-o"></use>
            </svg>
        </div>-->
    </div>

    <div class="price-detail">
        <div class="line line-transverse">
            <span>房租</span>
            <span class="highlight" v-cloak>￥{{info.rent_price}}</span>
        </div>
        <div class="line line-transverse">
            <span>住宿意外险</span>
            <span class="highlight" v-cloak>￥{{Number(info.insurance_count)*.5*Number(info.day_total)}}</span>
        </div>
        <div class="line line-transverse">
            <span>在线支付押金</span>
            <span class="highlight" v-cloak>￥{{info.deposit}}</span>
        </div>
        <div class="line line-transverse" style="position: relative">
            <span v-if="info.deposit_status&&info.deposit_status.status===0" class="highlight">(暂未支付押金。)</span>
            <span v-if="info.deposit_status&&info.deposit_status.status===1" class="highlight">(押金已支付。)</span>
            <span v-if="(info.deposit_status&&info.deposit_status.status===2)&&(role==='fd')" class="highlight">(房客押金已支付。)</span>
            <span v-if="(info.deposit_status&&info.deposit_status.status===2)&&(role==='fk')" class="highlight">(若房东在订单完成24小时内未提出押金扣除的要求，在线押金将根据支付方式原路退回。)</span>
            <span v-if="(info.deposit_status&&info.deposit_status.status===3)&&(role==='fd')" class="highlight">(您已提出了押金扣除的要求，正在等待平台审核，在此期间您可以与房客协商。如有异议，请联系客服。<a href="tel:4001177178">400-1177178</a>)</span>
            <span v-if="(info.deposit_status&&info.deposit_status.status===3)&&(role==='fk')" class="highlight">(房东提出了押金扣除的要求，正在等待平台审核，在此期间您可以与房东协商。如有异议，请联系客服。<a href="tel:4001177178">400-1177178</a>)</span>
            <span v-if="info.deposit_status&&info.deposit_status.status===5" class="highlight">(平台处理已完成，剩余的押金根据支付方式原路退回，如有异议，请联系客服。<a href="tel:4001177178">400-1177178</a>)</span>
            <span v-if="info.deposit_status&&info.deposit_status.status===99" class="highlight">(不收取押金。)</span>
        </div>
        <p v-cloak>押金由分享家誓为保管，订单完成后若房东没有提出扣押要求将根据支付方式原路返回。</p>
    </div>

    <!--<div v-cloak class="line handle cancel" v-if="info.status.status===0" @click="delIndent">删除订单</div>-->
    <div v-cloak class="line handle cancel"
         v-if="info.status.status===1||info.status.status===2||info.status.status===3" @click="cancelIndent">取消订单
    </div>
    <div v-cloak class="line handle highlight" v-if="info.status.status===2||info.status.status===22" @click="nowPay(info)">立即付款</div>
    <div v-cloak class="line handle cancel" v-if="info.status.status===4" @click="earlyLeave">提前退房</div>
    <!--<div v-cloak class="line handle highlight" v-if="info.status.status===5" @click="atOnceComment">立即点评</div>
    <div v-cloak class="line handle highlight" v-if="info.status.status===6" @click="checkComment">查看点评</div>-->
    <div class="line" @click="toggleGuysShow">
        <span>入住人</span>
        <span class="highlight" v-cloak>
            共{{info.guest_count}}位
            <svg class="icon">
                <use xlink:href="#icon-you"></use>
            </svg>
        </span>
    </div>
    <div v-show="showGuysDetail">
        <div class="line guys-line" v-for="guy of info.resident">
            <span v-cloak>{{guy.name}}</span>
            <span v-cloak>{{guy.nation_name}}</span>
            <span v-cloak>{{guy.is_verified==='0'?'身份未认证':'身份已认证'}}</span>
        </div>
    </div>

    <div class="reservation">
        <div v-cloak>预订人：{{info.tenant_nickname}}</div>
        <div v-cloak>手机号：{{info.tenant_phone}}</div>
        <div v-cloak>下单时间：{{new Date(Number(info.date+'000')).toLocaleString()}}</div>
        <div v-cloak>订单编号：{{info.oid}}</div>
    </div>
</main>

<script type="text/javascript" src="../lib/js/babel-polyfill.js"></script>
<script type="text/javascript" src="../lib/js/vue.js"></script>
<script type="text/javascript" src="../lib/js/mui.js"></script>
<script type="text/javascript" src="../lib/js/jquery.js"></script>
<script type="text/javascript" src="../script/util.js"></script>

<script src="../script/indent_detail.js"></script>
</body>
</html>